package geometryComparison;

import java.util.ArrayList;

import java.util.List;

public class GeometricList {
    public static void main(String[] args) {
        GeometricObject g1 = new Rectangle(5, 5);
        GeometricObject g2 = new Circle(5);
        GeometricObject g3 = new Rectangle(7, 9);
        GeometricObject g4 = new Circle(9);


        List<GeometricObject> list = new ArrayList<>();
        list.add(g1);
        list.add(g2);
        list.add(g3);
        list.add(g4);

        list.sort(new GeometricObjectComparator());
        for (GeometricObject g:list){
            System.out.println(g.getArea());
        }

    }
}
